package pl.edu.pb.wi.pwnography.session;

import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;

@Component
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public class ChartLine {
    private static String titleJson = String.format("\"mainTitle\" : \"%s\"",
	    "Zależność jakości klasyfikatora");
    private static String xAxisJson = String.format("\"xAxisTitle\" : \"%s\"",
	    "Ilość sąsiadów");
    private static String yAxisJson = String.format("\"yAxisTitle\" : \"%s\"",
	    "Jakość klasyfikacji (w %)");

    private String series;

    public ChartLine() {
	this.series = "[ ]";
    }

    public String getSeries() {
	String seriesString = String.format("\"series\" : %s", series);
	return new StringBuilder("{").append(titleJson).append(",")
		.append(xAxisJson).append(",").append(yAxisJson).append(",")
		.append(seriesString).append("}").toString();
    }

    public void setSeries(String series) {
	this.series = series;
    }

}
